//
//  CallMeLFTableViewCell.m
//  NewMusic
//
//  Created by dllo on 15/11/21.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "CallMeLFTableViewCell.h"

@implementation CallMeLFTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self creatSubView];
    }
    return self;
}
- (void)creatSubView
{
    UIView *viewBL = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width / 2 - 1, 140)];
    viewBL.backgroundColor = [UIColor whiteColor];
    viewBL.alpha = 0.05;
    [self.contentView addSubview:viewBL];
    [viewBL release];
    
    UIView *viewBR = [[UIView alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 + 1, 0, [UIScreen mainScreen].bounds.size.width / 2 - 1, 140)];
    viewBR.backgroundColor = [UIColor whiteColor];
    viewBR.alpha = 0.05;
    [self.contentView addSubview:viewBR];
    [viewBR release];
    
    UIView *viewleft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width / 2, 140)];
    [self.contentView addSubview:viewleft];
    [viewleft release];
    
    UIView *viewRight = [[UIView alloc] initWithFrame:CGRectMake(viewleft.frame.size.width, 0, [UIScreen mainScreen].bounds.size.width / 2, viewleft.frame.size.height)];
    [self.contentView addSubview:viewRight];
    [viewRight release];

    UIImageView *imageViewLeft = [[UIImageView alloc] initWithFrame:CGRectMake(58.5, 20, 70, 70)];
    imageViewLeft.image = [UIImage imageNamed:[[NSBundle mainBundle] pathForResource:@"u=430960146,2309488234&fm=21&gp=0" ofType:@"png"]];
    imageViewLeft.backgroundColor = [UIColor whiteColor];
    imageViewLeft.userInteractionEnabled = YES;
    imageViewLeft.layer.cornerRadius = 35;
    imageViewLeft.layer.masksToBounds = YES;
    [viewleft addSubview:imageViewLeft];
    [imageViewLeft release];
    
    UIImageView *imageViewRight = [[UIImageView alloc] initWithFrame:CGRectMake(58.5, 20, 70, 70)];
    imageViewRight.image = [UIImage imageNamed:[[NSBundle mainBundle] pathForResource:@"u=3428430784,1088921690&fm=21&gp=0" ofType:@"jpg"]];
    imageViewRight.userInteractionEnabled = YES;
    imageViewRight.layer.cornerRadius = 35;
    imageViewRight.layer.masksToBounds = YES;
    [viewRight addSubview:imageViewRight];
    [imageViewRight release];
    
    UILabel *labelLeft = [[UILabel alloc] initWithFrame:CGRectMake(58.5, 95, 70, 30)];
    labelLeft.text = @"点个赞";
    labelLeft.textColor = [UIColor colorWithRed:220 / 255.0 green:220 / 255.0 blue:220 / 255.0 alpha:1.0];
    labelLeft.textAlignment = NSTextAlignmentCenter;
    [viewleft addSubview:labelLeft];
    [labelLeft release];
    
    UILabel *labelRight = [[UILabel alloc] initWithFrame:CGRectMake(58.5, 95, 70, 30)];
    labelRight.text = @"吐个槽";
    labelRight.textColor = [UIColor colorWithRed:220 / 255.0 green:220 / 255.0 blue:220 / 255.0 alpha:1.0];
    labelRight.textAlignment = NSTextAlignmentCenter;
    [viewRight addSubview:labelRight];
    [labelRight release];
    
    UITapGestureRecognizer *tapLeft = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapLeft)];
    [viewleft addGestureRecognizer:tapLeft];
    [tapLeft release];
    UITapGestureRecognizer *tapRight = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRight)];
    [viewRight addGestureRecognizer:tapRight];
    [tapRight release];
}
- (void)tapLeft
{
    [self.delegate NiceCallAndToEmail:0];
}
- (void)tapRight
{
    [self.delegate NiceCallAndToEmail:1];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
